{% extends 'airshow/base.html' %}

{% block title %}导出{{ table }}数据{% endblock %}

{% block content %}
<div class="container mt-4">
    <div class="row">
        <div class="col-md-8 offset-md-2">
            <div class="card">
                <div class="card-header bg-primary text-white">
                    <h5 class="mb-0">导出{{ table }}数据</h5>
                </div>
                <div class="card-body">
                    <p class="mb-4">您即将导出{{ table }}表的所有数据。导出文件为CSV格式，可用于备份或在其他系统中使用。</p>
                    
                    <div class="alert alert-info">
                        <p>导出的数据将包含以下字段：</p>
                        <p>
                            {% if table == 'area' %}
                                id, name, description, capacity
                            {% elif table == 'audience' %}
                                id, name, phone, email, address
                            {% elif table == 'exhibitor' %}
                                id, name, contact_person, phone, email, area_id
                            {% elif table == 'exhibit' %}
                                id, name, description, exhibitor_id
                            {% elif table == 'schedule' %}
                                id, exhibit_id, start_time, end_time, description
                            {% elif table == 'attendance' %}
                                id, audience_id, schedule_id, check_in_time
                            {% endif %}
                        </p>
                    </div>
                    
                    <div class="d-flex justify-content-between">
                        <a href="{% url 'airshow:direct_data' table=table %}" class="btn btn-secondary">返回</a>
                        <a href="{% url 'airshow:export_data' table=table %}" class="btn btn-success">下载CSV</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %} 